<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<form action="/upload" method="post" enctype='multipart/form-data'>
    <input name="fulAvatar" id="fulAvatar" type="file"/><br/>
    <input type="submit" value="点击上传"/>
</form>
<h3 id="txt"><%=text%></h3>
<h2 id="h2" style="visibility:hidden"><%= n %></h2>
<div id="container"></div>

<script>
    var h2 = document.getElementById("h2");
    if(h2.innerHTML != "空"){
        var bigImg = document.createElement("img");     //创建一个img元素
        var container = document.getElementById("container");//获得dom对象
        bigImg.width="100";
        bigImg.height="100";
        var path = h2.innerHTML;
        console.log(h2.innerHTML);
        console.log(path);
        bigImg.src = path;//给img元素的src属性赋值
        container.appendChild(bigImg);//为dom添加子元素img
    }
</script>
</body>
</html>